home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-20 | 12.9 KB | 385 lines | [TEXT/MPS ] |
- # Copyright © 1995 by Apple Computer, Inc. All rights reserved.
- # PCISlots.make
- #
- #FILE
- # PCISlots.make
- #
- #NAME
- # PCI Slot Peek application makefile
- #
- #DESCRIPTION
- # This make file contains Make instructions that builds the
- # PCI Slot Peek application
- #
- #MODIFICATION HISTORY
- # Created by Terry Teague
- #
- # 20 Apr 95 - TRT - Initial version
- # 17 Jul 95 - TRT - Tidy-up source for PPCC v1.0.5, Universal Headers v2.0 final,
- # CodeWarrior 6.1.
- #
- #=============================================================================================
- #
-
- #=============================================================================================
- # Common Variables
- #=============================================================================================
-
- Includes = :Includes:
- Sources = :Sources:
- Resources = :Resources:
- 68K_Objects = :68K_Objects:
- PPC_Objects = :PPC_Objects:
-
- MacsBug = off
- Symbols = off
-
- PPCCOpt = off
-
- PreUniHeaders = -d qPreUniHeaders=0 #set to 0 for Universal Headers
- OtherCOptions =
-
- #=============================================================================================
- # Variables needed to set up for this application
- #=============================================================================================
-
- BaseName = PCISlots
- 68K_sprintfLib =
- PPC_sprintfLib =
- 68K_ProgName = {BaseName}.68K
- PPC_ProgName = {BaseName}.PPC
- FAT_ProgName = {BaseName}.FAT
- RezName = {BaseName}.r
- RsrcName = {BaseName}.rsrc
- MakeName = {BaseName}.make
-
- # Pseudo targets - Build script controls if 68K and/or PPC builds are done
-
- Build68K = {68K_ProgName}
- BuildPPC = {PPC_ProgName}
-
- #=============================================================================================
- # Object files used by this example
- #=============================================================================================
-
- # We don't need the NameRegistry code for 68K since it is not supported in that mode
- 68K_LinkObjs = ∂
- "{68K_Objects}"{BaseName}.cp.68K.o ∂
- "{68K_Objects}"{BaseName}Utils.cp.68K.o
- # "{68K_Objects}"{BaseName}NameRegistry.cp.68K.o
-
- PPC_LinkObjs = ∂
- "{PPC_Objects}"{BaseName}.cp.PPC.o ∂
- "{PPC_Objects}"{BaseName}Utils.cp.PPC.o ∂
- "{PPC_Objects}"{BaseName}NameRegistry.cp.PPC.o
-
- #=============================================================================================
- # Standard Libraries used by this application
- #=============================================================================================
-
- 68K_SIOW_Lib = ∂
- "{Libraries}"SIOW.o
-
- 68K_Libraries = ∂
- # "{Libraries}Stubs.o" ∂
- "{CLibraries}"CPlusLib.o ∂
- "{CLibraries}"StdCLib.o ∂
- "{Libraries}"Runtime.o ∂
- "{Libraries}"Interface.o
-
- PPC_SIOW_Lib = ∂
- "{PPCLibraries}"PPCSIOW.o
-
- PPC_Libraries = ∂
- "{PCILibraries}"NameRegistryLib ∂
- "{PPCLibraries}"InterfaceLib.xcoff ∂
- "{PPCLibraries}"StdCLib.xcoff ∂
- "{PPCLibraries}"StdCRuntime.o ∂
- "{PPCLibraries}"PPCCRuntime.o ∂
- "{PPCLibraries}"MathLib.xcoff ∂
- "{PPCLibraries}"CPlusLib.o
-
- # The -w options for MakePef makes those libraries "weak" imports, meaning
- # they can be absent at runtime. The app must check before calling them.
- # All symbols in NameRegistryLib are weak-linked (~)
- # This doesn't work for me for some reason
- #
-
- PPC_LibEquates = ∂
- -l NameRegistryLib.xcoff=NameRegistryLib~ ∂
- -w NameRegistryLib:RegistryEntryIterateCreate ∂
- -w NameRegistryLib:RegistryEntryIterateDispose ∂
- -w NameRegistryLib:RegistryEntryIterate ∂
- -w NameRegistryLib:RegistryEntryIDDispose ∂
- -w NameRegistryLib:RegistryPropertyGetSize ∂
- -w NameRegistryLib:RegistryPropertyGet ∂
- -w NameRegistryLib:RegistryEntryToPathSize ∂
- -w NameRegistryLib:RegistryCStrEntryToPath ∂
- -l InterfaceLib.xcoff=InterfaceLib ∂
- -l StdCLib.xcoff=StdCLib ∂
- -l MathLib.xcoff=MathLib
-
- #=============================================================================================
- # Include Paths
- #=============================================================================================
-
- RezIncludePath = -i "{Includes}" -i "{RIncludes}" ∂
- -s : -s {Resources}
-
- CIncludes = "{PPCCIncludes}" # prevent C68K from using non-Universal Headers
-
- CIncludePath = -i "{Includes}" -i "{PPCCIncludes}" -i "{PCICIncludes}" #"{CIncludes}"
-
- PIncludePath =
-
- AIncludePath = -i "{Includes}" -i "{AIncludes}"
-
- CPlusIncludePath = -i "{Includes}" -i "{PPCCIncludes}" -i "{PCICIncludes}" #"{CIncludes}"
-
- PPCCIncludePath = -i "{Includes}" -i "{PPCCIncludes}" -i "{PCICIncludes}" #"{CIncludes}"
-
- #=============================================================================================
- # Other definitions
- #=============================================================================================
-
- OtherDependencies = ∂
- {BaseName}NameRegistry.PEF
-
- #=============================================================================================
- # Tool Options
- #=============================================================================================
-
- COptions = -mbg {MacsBug} -sym {Symbols} {PreUniHeaders} {CIncludePath} {OtherCOptions} ∂
- -mf -b2 -r
-
- POptions = -mbg {MacsBug} -sym {Symbols} {PIncludePath}
-
- AOptions = -sym {Symbols} {AIncludePath}
-
- CPlusOptions = -mbg {MacsBug} -sym {Symbols} {PreUniHeaders} {CPlusIncludePath} {OtherCOptions} ∂
- -mf -b2 -r #-warnings off -mark all #-load {Objects}headers.h.dump
-
- PPCCOptions = -sym {Symbols} {PreUniHeaders} {PPCCIncludePath} {OtherCOptions} ∂
- -w conformance -appleext on -opt {PPCCOPt}
-
- RezOptions = -c 'PCI?' -t APPL
-
- LinkOpts = -mf -c 'PCI?' -t APPL ∂
- -sym {Symbols}
-
- PPCLinkOpts = -warn -xm executable -main __cplusstart ∂
- -sym {Symbols}
-
- PEF_Options = -ft APPL -fc 'PCI?'
-
- #=============================================================================================
- # Default Rule Customization
- #=============================================================================================
-
- "{68K_Objects}" ƒ "{Sources}"
-
- "{PPC_Objects}" ƒ "{Sources}"
-
- .cp.68K.o ƒ .cp #{Objects}headers.h.dump
- CPlus "{Sources}{default}.cp" -o "{68K_Objects}{default}.cp.68K.o" {CPlusOptions}
-
- .cp.PPC.o ƒ .cp #{Objects}headers.h.dump
- PPCC "{Sources}{default}.cp" -o "{PPC_Objects}{default}.cp.PPC.o" {PPCCOptions}
-
- .a.o ƒ .a
- Asm "{Sources}{default}.a" -o "{68K_Objects}{default}.a.o" {AOptions}
-
- .c.68K.o ƒ .c
- C "{Sources}{default}.c" -o "{68K_Objects}{default}.c.68K.o" {COptions}
-
- .c.PPC.o ƒ .c
- PPCC "{Sources}{default}.c" -o "{PPC_Objects}{default}.c.PPC.o" {PPCCOptions}
-
- "{68K_Objects}"{BaseName}.cp.68K.o ƒ "{Sources}"{BaseName}.cp ∂
- "{Includes}"{BaseName}.h
-
- "{PPC_Objects}"{BaseName}.cp.PPC.o ƒ "{Sources}"{BaseName}.cp ∂
- "{Includes}"{BaseName}.h
-
- "{68K_Objects}"{BaseName}NameRegistry.cp.68K.o ƒ "{Sources}"{BaseName}NameRegistry.cp ∂
- "{Includes}"{BaseName}.h
-
- "{PPC_Objects}"{BaseName}NameRegistry.cp.PPC.o ƒ "{Sources}"{BaseName}NameRegistry.cp ∂
- "{Includes}"{BaseName}.h
-
- "{PPC_Objects}"{BaseName}Utils.cp.PPC.o ƒ "{Sources}"{BaseName}Utils.cp ∂
- "{Includes}"{BaseName}.h
-
- #=============================================================================================
- # Makefile Dependency
- # Add '#' in front of the build rule if you do not want that group of object files to
- # depend on the makefile.
- #=============================================================================================
-
- #{68K_LinkObjs} ƒ "{MakefileName}"
-
- #{PPC_LinkObjs} ƒ "{MakefileName}"
-
- #=============================================================================================
- # Include-file Dependences
- # List only the files that include other files
- #=============================================================================================
-
- #=============================================================================================
- # Special compiler options
- # For sources files that need special compiler options like -s segName or -d
- #=============================================================================================
-
- #=============================================================================================
- # Build Commands
- #=============================================================================================
-
- "{BaseName}" ƒ "{Build68K}" "{BuildPPC}" # build 68K and/or PPC versions (pseudo targets)
- If ("{Build68K}" != "") And ("{BuildPPC}" != "")
-
- # Duplicate the PowerPC code into the fat binary package.
-
- duplicate -y {PPC_ProgName} {FAT_ProgName}
-
- # rez in 'CODE' resources from 68K version. (Brute force method).
-
- echo "include ∂"{68K_ProgName}∂" 'CODE';" | rez -a -o {FAT_ProgName}
-
- # delete 'cfrg' resources from 68K version. (Brute force method).
- # Get the PEF container and store it into a resource in the 68K version. (Brute force method).
-
- echo "read 'XCOF' (10000, ∂"native PPC NameRegistry code∂") ∂"PCISlotsNameRegistry.PEF∂"; delete 'cfrg';" ∂
- | rez -a -o {68K_ProgName}
-
- Else If ("{Build68K}" != "")
-
- # delete 'cfrg' resources from 68K version. (Brute force method).
- # Get the PEF container and store it into a resource in the 68K version. (Brute force method).
-
- echo "read 'XCOF' (10000, ∂"native PPC NameRegistry code∂") ∂"PCISlotsNameRegistry.PEF∂"; delete 'cfrg';" ∂
- | rez -a -o {68K_ProgName}
-
- End
-
- #=============================================================================================
- # Build the resource file(s)
- #=============================================================================================
-
- "{68K_ProgName}" ƒƒ "{Resources}{RezName}" ∂
- "{Resources}{RsrcName}" ∂
- {BaseName}NameRegistry.PEF ∂
- {OtherDependencies}
- If "{BuildPPC}" != ""
- # need to make sure we Rez in the PowerPC native stuff if we are building a FAT application
- # because currently the Make file will only build the 68K version of the resource file
- Rez {RezIncludePath} ∂
- {RezOptions} ∂
- -d APPNAME=∂"{PPC_ProgName}∂" ∂
- "{Resources}{RezName}" ∂
- -append ∂
- -o "{68K_ProgName}"
- Else
- Rez {RezIncludePath} ∂
- {RezOptions} ∂
- "{Resources}{RezName}" ∂
- -append ∂
- -o "{68K_ProgName}"
- End
-
- "{PPC_ProgName}" ƒƒ "{Resources}{RezName}" ∂
- "{Resources}{RsrcName}" ∂
- {OtherDependencies}
- Rez {RezIncludePath} ∂
- {RezOptions} ∂
- -d APPNAME=∂"{PPC_ProgName}∂" ∂
- "{Resources}{RezName}" ∂
- -append ∂
- -o "{PPC_ProgName}"
-
- #=============================================================================================
- # Link the 68K code
- #=============================================================================================
-
- {68K_ProgName} ƒƒ {68K_LinkObjs} {68K_sprintfLib}
- Link ∂
- {LinkOpts} ∂
- {68K_LinkObjs} ∂
- {68K_sprintfLib} ∂
- {68K_SIOW_Lib} ∂
- {68K_Libraries} ∂
- -o {68K_ProgName}
- # -map ∂
- # > "{68K_ProgName}".map
-
- #=============================================================================================
- # Link the native PPC code
- #=============================================================================================
-
- {PPC_ProgName} ƒƒ {BaseName}.xcoff
- MakePEF {PEF_Options} ∂
- {BaseName}.xcoff ∂
- {PPC_LibEquates} ∂
- -o {PPC_ProgName}
-
- {BaseName}.xcoff ƒ {PPC_LinkObjs} {PPC_sprintfLib}
- PPCLink ∂
- {PPC_LinkObjs} ∂
- {PPC_sprintfLib} ∂
- {PPC_SIOW_Lib} ∂
- {PPC_Libraries} ∂
- #
- # This option is required for the new version of PPCLink (1.0.5), and is not
- # supported with older versions
- #
- -outputFormat xcoff ∂
- #
- {PPCLinkOpts} ∂
- -o {BaseName}.xcoff
- If "{Symbols}" =~ /[oO][nN]/
- #
- # Suppress warnings because of boring "Can't find file:" messages for lib routines.
- #
- MakeSYM -w {BaseName}.xcoff
- End
-
- #=============================================================================================
- # Link the native PPC code that is used by a 68K version of the application
- #=============================================================================================
-
- {BaseName}NameRegistry.PEF ƒƒ {BaseName}.NameRegistry.xcoff
- MakePEF ∂
- # -i InitNativeNameRegistry ∂
- {PEF_Options} ∂
- {BaseName}.NameRegistry.xcoff ∂
- {PPC_LibEquates} ∂
- -o {BaseName}NameRegistry.PEF
-
- {BaseName}.NameRegistry.xcoff ƒ "{PPC_Objects}"{BaseName}NameRegistry.cp.PPC.o {PPC_sprintfLib}
- PPCLink ∂
- "{PPC_Objects}"{BaseName}NameRegistry.cp.PPC.o ∂
- {PPC_sprintfLib} ∂
- {PPC_Libraries} ∂
- #
- # This option is required for the new version of PPCLink (1.0.5), and is not
- # supported with older versions
- #
- -outputFormat xcoff ∂
- #
- -warn -xm sharedLibrary -sym {Symbols} ∂
- -export RegistryEntryIterateCreateRD ∂
- -export RegistryEntryIterateDisposeRD ∂
- -export RegistryEntryIterateRD ∂
- -export RegistryEntryIDDisposeRD ∂
- -export RegistryPropertyGetSizeRD ∂
- -export RegistryPropertyGetRD ∂
- -export RegistryEntryToPathSizeRD ∂
- -export RegistryCStrEntryToPathRD ∂
- -o {BaseName}.NameRegistry.xcoff
- If "{Symbols}" =~ /[oO][nN]/
- #
- # Suppress warnings because of boring "Can't find file:" messages for lib routines.
- #
- MakeSYM -w {BaseName}.NameRegistry.xcoff
- End
-
-